/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gft.bancosimulador.views;

import com.gft.bancosimulador.beans.ClienteFisico;
import java.awt.Component;
import com.gft.bancosimulador.controller.*;

/**
 *
 * @author AEPI
 */
public class PrincipalView extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */ 
    boolean fisico;
    
    public PrincipalView() {
        initComponents();

        
    }
    
    public void mostrarJanela(Component c){
        dkt_Principal.add(c);
        c.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        dkt_Principal = new javax.swing.JDesktopPane();
        mnu_Principal = new javax.swing.JMenuBar();
        mnu_Agencias = new javax.swing.JMenu();
        mni_Agencias = new javax.swing.JMenuItem();
        mnu_Clientes = new javax.swing.JMenu();
        mni_CadastrarClienteFisico = new javax.swing.JMenuItem();
        mni_CadastrarClienteJuridico = new javax.swing.JMenuItem();
        mni_VisualizarCliente = new javax.swing.JMenuItem();
        mni_AlterarCliente = new javax.swing.JMenuItem();
        mni_BloquearCliente = new javax.swing.JMenuItem();
        mni_CancelarCliente = new javax.swing.JMenuItem();
        mni_ReativarCliente = new javax.swing.JMenuItem();
        mni_ConsultarCliente = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenuItem2.setText("jMenuItem2");

        jMenuItem4.setText("jMenuItem4");

        jMenuItem3.setText("jMenuItem3");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Simulador Bancario");

        dkt_Principal.setBackground(new java.awt.Color(255, 255, 255));
        dkt_Principal.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);

        javax.swing.GroupLayout dkt_PrincipalLayout = new javax.swing.GroupLayout(dkt_Principal);
        dkt_Principal.setLayout(dkt_PrincipalLayout);
        dkt_PrincipalLayout.setHorizontalGroup(
            dkt_PrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        dkt_PrincipalLayout.setVerticalGroup(
            dkt_PrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 288, Short.MAX_VALUE)
        );

        mnu_Agencias.setText("Agencias");

        mni_Agencias.setText("Agencias");
        mni_Agencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_AgenciasActionPerformed(evt);
            }
        });
        mnu_Agencias.add(mni_Agencias);

        mnu_Principal.add(mnu_Agencias);

        mnu_Clientes.setText("Clientes");

        mni_CadastrarClienteFisico.setText("Cadastrar Cliente Fisico");
        mni_CadastrarClienteFisico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_CadastrarClienteFisicoActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_CadastrarClienteFisico);

        mni_CadastrarClienteJuridico.setText("Cadastrar Cliente Juridico");
        mni_CadastrarClienteJuridico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_CadastrarClienteJuridicoActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_CadastrarClienteJuridico);

        mni_VisualizarCliente.setText("Visualizar Cliente");
        mni_VisualizarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_VisualizarClienteActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_VisualizarCliente);

        mni_AlterarCliente.setText("Alterar Cliente");
        mnu_Clientes.add(mni_AlterarCliente);

        mni_BloquearCliente.setText("Bloquear Cliente");
        mni_BloquearCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_BloquearClienteActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_BloquearCliente);

        mni_CancelarCliente.setText("Cancelar Cliente");
        mni_CancelarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_CancelarClienteActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_CancelarCliente);

        mni_ReativarCliente.setText("Reativar Cliente");
        mni_ReativarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_ReativarClienteActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_ReativarCliente);

        mni_ConsultarCliente.setText("Consultar Cliente");
        mni_ConsultarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mni_ConsultarClienteActionPerformed(evt);
            }
        });
        mnu_Clientes.add(mni_ConsultarCliente);

        mnu_Principal.add(mnu_Clientes);

        setJMenuBar(mnu_Principal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dkt_Principal)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dkt_Principal)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mni_AgenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_AgenciasActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new AgenciaView());
    }//GEN-LAST:event_mni_AgenciasActionPerformed

    private void mni_CadastrarClienteFisicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_CadastrarClienteFisicoActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new ClienteFisicoController());
    }//GEN-LAST:event_mni_CadastrarClienteFisicoActionPerformed

    private void mni_CadastrarClienteJuridicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_CadastrarClienteJuridicoActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new ClienteJuridicoController());
        
    }//GEN-LAST:event_mni_CadastrarClienteJuridicoActionPerformed

    private void mni_CancelarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_CancelarClienteActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new CancelarClienteController());
    }//GEN-LAST:event_mni_CancelarClienteActionPerformed

    private void mni_ReativarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_ReativarClienteActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new ReativarClienteController());
    }//GEN-LAST:event_mni_ReativarClienteActionPerformed

    private void mni_ConsultarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_ConsultarClienteActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new ConsultaView());
    }//GEN-LAST:event_mni_ConsultarClienteActionPerformed

    private void mni_VisualizarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_VisualizarClienteActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new ConsultarClienteController());
    }//GEN-LAST:event_mni_VisualizarClienteActionPerformed

    private void mni_BloquearClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mni_BloquearClienteActionPerformed
        // TODO add your handling code here:
        this.mostrarJanela(new BloquearClienteController());
        
    }//GEN-LAST:event_mni_BloquearClienteActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PrincipalView().setVisible(true);
            }
        });
    }
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane dkt_Principal;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem mni_Agencias;
    private javax.swing.JMenuItem mni_AlterarCliente;
    private javax.swing.JMenuItem mni_BloquearCliente;
    private javax.swing.JMenuItem mni_CadastrarClienteFisico;
    private javax.swing.JMenuItem mni_CadastrarClienteJuridico;
    private javax.swing.JMenuItem mni_CancelarCliente;
    private javax.swing.JMenuItem mni_ConsultarCliente;
    private javax.swing.JMenuItem mni_ReativarCliente;
    private javax.swing.JMenuItem mni_VisualizarCliente;
    private javax.swing.JMenu mnu_Agencias;
    private javax.swing.JMenu mnu_Clientes;
    private javax.swing.JMenuBar mnu_Principal;
    // End of variables declaration//GEN-END:variables
}
